﻿/*
 * 由SharpDevelop创建。
 * 用户： Joy
 * 日期: 2013/9/23
 * 时间: 23:49
 * 
 * 要改变这种模板请点击 工具|选项|代码编写|编辑标准头文件
 */
using System;

namespace LongestCommonSubsequence
{
	/// <summary>
	/// Description of LongestCommonSequence.
	/// </summary>
	public class LongestCommonSequence
	{
		private enum Direction 
		{
			Left,
			Up,
			UpLeft,
			UpOrLeft,
			End
		}
		public String X {get; set;}
		public String Y {get; set;}
		
		public String[] CalculateLongestCommonSequence()
		{
			Int32 [,] c = new Int32[X.Length, Y.Length];
			Direction[,] d = new Direction[X.Length, Y.Length];
			
			for (int i = 0; i < X.Length; i++) 
			{
				for(int j = 0; j < Y.Length; j++)
				{	
					if(i == 0 | j == 0) 
					{
						if(X[i] == Y[j])
							//c[i, j] == 1;
							;
						else
							//c[i, j] == 0;
							;
					}
					else
					{
						if(X[i] == Y[i])
						{
							//c[i, j] == c[i-1, j-1] + 1;
						}
						else
						{
							if(c[i-1, j] > c[i, j-1])
							{
									
							}
							else if(c[i-1, j] == c[i, j-1]) 
							{
									
							}
							else if(c[i-1, j] < c[i, j-1])
							{
									
							}
						}
					}
					
				}
			}
			
			return null;
		}
		
		
		
	}
}
